package com.demo;

import java.io.File;
import java.io.FileReader;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Properties;

public class FileList {

	public static void main(String[] args) throws Exception {
		Properties p = new Properties();
		p.load(new FileReader("src/jdbc.properties"));
		System.out.println(p.getProperty("name"));
		//	list("E:\\1.java基础");
		Path path = Paths.get("E:\\Git\\GitHub入门与实践.pdf");
		System.out.println(path.getFileName());
		
//		int sum = getNum(1);
//		System.out.println(sum);
	}
	public static  int getNum(int day){
		if(day ==10){
			return 1;
		}else{
			return 2* (getNum(day+1)+1);
		}
	}
	public static void list(String path){
		File file = new File(path);
		File [] files = file.listFiles();
		for (File tempFile : files) {
			if(tempFile.isFile()){
				System.out.println("文件:"+tempFile.getName());
			}else if(tempFile.isDirectory()){
				System.out.println("目录:"+tempFile.getName());
				list( tempFile.getAbsolutePath() );
			}
		}
	}

}
